package com.yixun.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author admin lbx create by 2021/5/7 8:14
 * @apiNote WebConfig
 */
@Configuration
public class WebConfig  implements WebMvcConfigurer {
    @Value("${wisdom_bee.upload}")
    public  String WISDOM_BEE_UPLOAD;
    //public static final String WISDOM_BEE_UPLOAD = "file:C:/wisdom_bee/upload/";
    
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        WebMvcConfigurer.super.addResourceHandlers(registry);
        registry.addResourceHandler("/file/**").addResourceLocations("file:"+WISDOM_BEE_UPLOAD);
    }
}
